<template>
  <Mapbox :mapOnLoadCB="mapOnLoadCB"></Mapbox>
</template>

<script>
import {ref} from "vue"
import Mapbox from "@/components/common/Mapbox.component.vue"

export default {
  name: "LimitMapRange.component",
  components: {Mapbox},
  setup() {

    let mapStore = ref({});
    let mapOnLoadCB = (map) => {
      mapStore.value = map;

      // 设置maxBounds，防止地图平移到其他地方。
      map.setMaxBounds([
        [106.04728500751165, 29.68392799015035], // Southwest coordinates
        [106.91058699000139, 29.87764500765852]  // Northeast coordinates
      ])
    };

    return {
      mapOnLoadCB
    }
  }
}
</script>

<style scoped>

</style>